{template common/header}
{template user/userheader}
<div class="container mt20">
	<div class="span12 main">
		{template user/usernav}
		<div class="messages">
			<h4 class="mt10 text_c">
			{lang tip_user_settings}
			</h4>
         <form id="update_userinfo" action="{url user/updateuserinfo}" class="form-horizontal mt10" method="post">
         	<fieldset>
					<div class="control-group">
			            <label class="control-label" for="email">{lang label_image_settings}</label>
			            <div class="controls">
			                <button type="button" class="btn" data-action="openAvatar">{lang label_create_avatar}</button>
							<p class="help-block">{lang tip_open_new_win}</p>
			            </div>
			        </div>
			        
					<div class="control-group">
			            <label class="control-label" for="nickname">{lang user_nickname}</label>
			            <div class="controls">
			                <input id="nickname" type="text" name="nickname" value="$user['nickname']" remote="{url user/nicknameupdatecheck}" remote-error="{lang 500_nickname_existed:tip}" not-valid="{lang 500_nick_not_valid:tip}"/>
							<p class="help-block">{lang nick_not_valid}</p>
			            </div>
			        </div>
			        
					<!--<div class="control-group">
			            <label class="control-label" for="usertitle">{lang custom_title}</label>
			            <div class="controls">
			                <input id="usertitle" type="text" name="usertitle" value="{$user['user_title']}"/>
							<p class="help-block">{lang tip_custom_title}</p>
			            </div>
			        </div>-->
			        
					<div class="control-group">
			            <label class="control-label" for="usertitle">{lang user_domain}</label>
			            <div class="controls">
  							<input id="domain" type="text" name="domain" class="span2" value="{$user['domain']}" remote="{url user/domaincheck}" remote-error="{lang 500_existed:tip}"/>
							<p class="help-block">{echo host_url()}{url home/domain?sname=***}</p>
			            </div>
			        </div>
			          
					<div class="control-group">
			            <label class="control-label" for="gender">{lang label_gender}</label>
			            <div class="controls">
			                <input type="radio" name="gender" id="optionsRadios1" value="male" {if $user['gender']=='male'}checked{/if}> {lang male}
 							<input type="radio" name="gender" id="optionsRadios2" value="female"  {if $user['gender']=='female'}checked{/if}>{lang female}
 							<input type="radio" name="gender" id="optionsRadios3" value="none" {if !$user['gender']||$user['gender']=='none'}checked{/if}>{lang keep_secret}
			            </div>
			        </div>
			        {if $language=='zh_cn'}
					<!--<div class="control-group">
			            <label class="control-label" for="province">{lang label_location}</label>
			            <div class="controls">
			            	<select id="province" name="province" class="span2"></select>&nbsp;&nbsp;
						  	<select id="city" name="city" class="span2"></select>
			              	<script type="text/javascript" src="{baseurl}assets/js/city_utf8.js"></script>
			              	<script type="text/javascript">
								initPlace('{$user['city']}','{$user['province']}');
						  	</script>
			            </div>
			        </div>-->
			        {else}
					<!--<div class="control-group">
			            <label class="control-label" for="province">{lang State}</label>
			            <div class="controls">
			            	<input id="province" type="text" name="province" value="{$user['province']}"/>
			            </div>
			        </div>
					<div class="control-group">
			            <label class="control-label" for="city">{lang City}</label>
			            <div class="controls">
							<input id="city" type="text" name="city" value="{$user['city']}"/>
			            </div>
			        </div>-->
					{/if}
					<div class="control-group">
			            <label class="control-label" for="bio">{lang user_description}</label>
			            <div class="controls">
            				<textarea id="bio" name="bio" rows="6" class="span4">{$user['bio']}</textarea>
			            </div>
			        </div>
			        <div class="control-group">
			        	<label class="control-label"></label>
			            <div class="controls">
			            <button type="submit" class="btn btn-primary submit-btn" data-loading-text="{lang tip_loading}">{lang save}</button>
			            </div>
			        </div>
         	</fieldset>
    	</form>
       </div>
	</div>
</div>
<script>
$(document).ready(function() {
	$.oValidate('update_userinfo');
});
</script>
{template common/footer}
